<?php

define ("DIRECT_ACCESS", true);
include($_SERVER['DOCUMENT_ROOT']."/conf/conf.php");
$im = imagecreatefrompng(ROOT_DIR."/i/cimg.png");

$tc  = imagecolorallocate ($im, 255, 255, 255);
$font = ROOT_DIR."/i/tahomabd.ttf";

$num1 = $_SESSION['num1'];
$num2 = $_SESSION['num2'];
switch($_SESSION['random_result'])
{
    case 1:imagettftext  ($im, 12, 0, 11, 21, $tc, $font, $num1." + ".$num2." = ? ");break;
    case 2:imagettftext  ($im, 12, 0, 11, 21, $tc, $font, $num1." * ".$num2." = ? ");break;
}
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>